/**
 * 
 */
package edu.vanderbilt.vshare.multicast;

/**
 * simple client demonstrating the SRInputStream class
 * @author jedmondson
 *
 */

public class Client {

	public static final int DEFAULT_PORT = 10000;
	public static final int payloadSize = 16384; 
	
	/**
	 * @param args   command line arguments passed by the user
	 */
	public static void main(String[] args) {
		
		// register our shutdown hook for closing the server gracefully
		ClientShutdown sh = new ClientShutdown();
		Runtime.getRuntime().addShutdownHook(sh);
		
		SRInputStream stream = new SRInputStream();

		stream.listen("228.5.6.7");
		stream.listen("228.5.6.8");
		stream.listen("228.5.6.10");
		stream.listen("228.5.6.11");
		
		byte [] bob_file = stream.read("bob.txt");
		byte [] output_file = stream.read("output.txt");
		byte [] pres_file = stream.read("pres1.ppt");
		
		System.out.println ("The client has received all files.");
		
		System.out.println ("bob.txt length = " + bob_file.length);
		System.out.println ("output.txt length = " + output_file.length);
		System.out.println ("pres1.ppt length = " + pres_file.length);
	}

}
